package com.feng.picture.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.feng.picture.pojo.dto.file.UploadPictureResult;
import com.feng.picture.pojo.dto.picture.PictureQueryRequest;
import com.feng.picture.pojo.dto.picture.PictureReviewRequest;
import com.feng.picture.pojo.dto.picture.PictureUploadByBatchRequest;
import com.feng.picture.pojo.dto.picture.PictureUploadRequest;
import com.feng.picture.pojo.entity.Picture;
import com.feng.picture.pojo.entity.User;
import com.feng.picture.pojo.vo.PictureVO;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.multipart.MultipartFile;

/**
* @author Liquor
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-08-30 23:23:09
*/
public interface PictureService extends IService<Picture> {

    PictureVO uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest, User loginUser);

    PictureVO getPictureVO(Picture picture, HttpServletRequest request);

    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

    Page<PictureVO> getPictureVOPageWithCache(PictureQueryRequest pictureQueryRequest, HttpServletRequest request);

    void doPictureReview(PictureReviewRequest pictureReviewRequest, User loginUser);

    int uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, User loginUser);

    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);

    void validPicture(Picture picture);

    void fillReviewParams(Picture picture, User loginUser);

    @Async
    void clearPictureFile(Picture oldPicture);

    String extractKeyFromUrl(String url);
}
